import config from "@/config"
import http from "@/utils/request"

export default {
    getList: {
        url: `${config.API_URL}/displayIndustry/list`,
        name: "获取行业列表",
        get: function (data = {}) {
            return new Promise((resolve, reject) => {
                http.get(this.url, data).then((response) => {
                    resolve(response)
                }).catch((error) => {
                    resolve(error.data)
                })
            })
        }
    },
    add: {
        url: `${config.API_URL}/displayIndustry/add`,
        name: "添加行业",
        post: function (data = {}) {
            return new Promise((resolve, reject) => {
                http.post(this.url, data).then((response) => {
                    resolve(response)
                }).catch((error) => {
                    resolve(error.data)
                })
            })
        }
    },
    update: {
        url: `${config.API_URL}/displayIndustry/update`,
        name: "修改行业",
        post: function (data = {}) {
            return new Promise((resolve, reject) => {
                http.post(this.url, data).then((response) => {
                    resolve(response)
                }).catch((error) => {
                    resolve(error.data)
                })
            })
        }
    },
    delete: {
        url: `${config.API_URL}/displayIndustry/delete`,
		name: "删除行业",
		post: function (data = {}) {
			return new Promise((resolve, reject) => {
				http.postParam(this.url, data).then((response) => {
					resolve(response)
				}).catch((error) => {
					resolve(error.data)
				})
			})
		}
    }
}